import { request } from './requests'

// 获取参数列表
export function getCategoriesAttributes(id, sel) {
    return request({
        url: 'categories/' + id + '/attributes',
        params: { sel: sel }
    })
}


// 添加动态参数或者静态属性
export function addCategoriesAttributes(id, data) {
    return request({
        url: 'categories/' + id + '/attributes',
        method: 'post',
        data: data
    })
}

// 修改动态参数或者静态属性
export function editCategoriesAttributes(id, attrId, dat) {
    return request({
        url: 'categories/' + id + '/attributes/' + attrId,
        method: 'put',
        data: dat
    })
}

// 删除动态参数或者静态属性
export function deleteCategoriesAttributes(id, attrId) {
    return request({
        url: 'categories/' + id + '/attributes/' + attrId,
        method: 'delete'
    })
}